# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=zeal
pkgver=0.6.1_git20211225
_gitrev=763edca12ccd6c67e51f10891d1ced8b2510904f
pkgrel=0
pkgdesc="Offline documentation browser inspired by Dash"
url="https://zealdocs.org/"
arch="all !armhf !ppc64le !s390x !riscv64"  # blocked by qt5-qtwebengine
license="GPL-3.0-only"
depends="hicolor-icon-theme"
makedepends="
	cmake
	extra-cmake-modules
	libarchive-dev
	qt5-qtbase-dev
	qt5-qtwebengine-dev
	qt5-qtx11extras-dev
	samurai
	sqlite-dev
	xcb-util-keysyms-dev
	"
source="https://github.com/zealdocs/zeal/archive/$_gitrev/zeal-$_gitrev.tar.gz"
builddir="$srcdir/$pkgname-$_gitrev"
options="!check"  # no tests provided

build() {
	local crossopts=
	if [ "$CBUILD" != "$CHOST" ]; then
		crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -G Ninja -B build \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=OFF \
		$crossopts .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
19dcfa813521c1dc65a5abda6689f60b628ffc1847b4e2ea3dccfcf9f4575352dc081f7d82dc422da0370c82052b839a198262b8aafcf37d2f0e908bc063dc7e  zeal-763edca12ccd6c67e51f10891d1ced8b2510904f.tar.gz
"
